# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-jsonpickle
pkgver=3.4.1
pkgrel=0
pkgdesc="Serializing any arbitrary object graph into JSON"
url="https://pypi.org/project/jsonpickle/"
arch="noarch"
license="BSD-3-Clause"
depends="py3-tzdata"
makedepends="py3-gpep517 py3-setuptools py3-setuptools_scm py3-wheel"
checkdepends="py3-pytest py3-numpy py3-pandas"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/j/jsonpickle/jsonpickle-$pkgver.tar.gz
	pandas2.patch
	"
builddir="$srcdir/jsonpickle-$pkgver"

replaces="py-jsonpickle" # Backwards compatibility
provides="py-jsonpickle=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	# ecdsa: no gmpy
	# roundtrip: breaks on 32bit
	.testenv/bin/python3 -m pytest tests \
		--deselect tests/ecdsa_test.py \
		-k 'not test_multindex_dataframe_roundtrip'
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
eaabeb0a523ee95d92cc73de71034d060de17118869d91de61f36592f38c736a50f09750dab74473d1eda88f7c2f18cc5872261727f317bb2b116e6e68d44fdd  jsonpickle-3.4.1.tar.gz
f9bfea88de20248b7f3f72633c5e189966313de858956a832c2eb9f8afb4917cb26cfbf949b6ac77f25a7e6f1683f5b8b146f6c1021cb2a63e9605ae00fe2884  pandas2.patch
"
